package com.wp.design.structural.composite;

public class Test {
	public static void main(String[] args) {
		CatalogComponent courseCatalog = new CourseCatalog("主目录",1);
		CatalogComponent catalog1 = new CourseCatalog("前端目录",2);

		CatalogComponent vue = new Course("vue课程",198.0);
		CatalogComponent extjs = new Course("ext课程",98.0);
		catalog1.add(vue);
		catalog1.add(extjs);
		courseCatalog.add(catalog1);
		CatalogComponent catalog2 = new CourseCatalog("后端目录",2);
		CatalogComponent java = new Course("java课程",398.0);
		CatalogComponent phyton = new Course("phyton课程",298.0);
		catalog2.add(java);
		catalog2.add(phyton);
		courseCatalog.add(catalog2);

		courseCatalog.print();
	}
}
